package com.ygqh.customs.domain;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONType;
import com.ygqh.common.AbstractObject;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 〈〉
 *
 * @author guohao
 * @date 2019/3/14 18:40
 * @since 1.0.0
 */
@JSONType(orders = {"sessionID", "payExchangeInfoHead", "payExchangeInfoLists", "serviceTime", "certNo", "signValue"})
@EqualsAndHashCode(callSuper = true)
@Data
public class PayExInfo extends AbstractObject {

    private static final long serialVersionUID = -8505201375783617496L;


    private Long dataUpId;

    private String sessionID;

    private PayExchangeInfoHead payExchangeInfoHead;

    private List<PayExchangeInfoList> payExchangeInfoLists;

    private long serviceTime;
    private String certNo;
    private String signValue;


    public String toPayExchangeInfoHeadJSONString() {
        if (payExchangeInfoHead == null) {
            return "{}";
        }
        return JSON.toJSONString(payExchangeInfoHead);
    }

    public String toPayExchangeInfoListsJSONString() {
        if (payExchangeInfoLists == null) {
            return "{}";
        }
        return JSON.toJSONString(payExchangeInfoLists);
    }

    public String toJSONString() {
        return JSON.toJSONString(this);
    }
}
